package com.example.swagger.controller;

import com.example.swagger.model.Cat;
import com.example.swagger.model.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

//@RestController
@Controller
@ResponseBody
@RequestMapping("/user")
public class UserController {
    @GetMapping
    public String getUser(@RequestBody Cat cat){
        return "张三";
    }
    @PostMapping
    public String addUser(@RequestHeader("token")String token, String username){
        return username;
    }
//    @DeleteMapping
//    public User deleteUser(){
//        //构造User
//        User quanc = new User("张三", "10");
//        return quanc;
//    }

    //@RequestBody  返回json
    @PutMapping
    public String putUser(@RequestBody User user ){
        return "user";
    }
}
